from zoukao3.Base.Base import Base
from selenium.webdriver.common.by import By
# 页面类
class Page(Base):
    # 点击登录
    login_loc=(By.ID,'s-top-loginbtn')
    # 进入iframe框架
    iframe1_loc=(By.ID,'TANGRAM__PSP_11__form')
    #断言登录成功
    dy1_loc=(By.ID,'//*[@id="TANGRAM__PSP_11__changePwdCodeItem"]')
    # 输入账号
    username_loc=(By.NAME,'userName')
    # 输入密码
    password_loc=(By.NAME,'password')
    # 勾选同意
    agree_loc=(By.NAME,'isAgree')
    #点击登录
    loginbtn_loc=(By.ID,'TANGRAM__PSP_11__submit')

    def login(self):
        self.click(self.login_loc)

    def dy1(self):
        self.text(self.dy1_loc)

    def iframe1(self):
        self.iframe(self.iframe1_loc)

    def username(self):
        self.send_keys(self.username_loc,'18986670716')

    def password(self):
        self.send_keys(self.password_loc,'zxr2004zxr')

    def agree(self):
        self.click(self.agree_loc)

    def loginbtn(self):
        self.click(self.loginbtn_loc)

    def baidu_luoji_01(self):
        self.open_url('https://www.baidu.com/')
        self.login()
        # print(self.dy1())
        # assert '账号登录' ==self.dy1()
        self.username()
        self.password()
        # self.iframe1()
        self.agree()
        self.loginbtn()






